package csw;

public class J12Fan {

	public static void main(String[] args) {
		Fan yfan  = new Fan();
		yfan.radius = 10;
		yfan.color = "yellow";
		yfan.speed = yfan.FAST;  	//주의!
		yfan.on = true;
		System.out.println(yfan.toString());
		
		Fan bfan = new Fan();
		bfan.radius = 10;
		bfan.color = "blue";
		bfan.speed = bfan.MEDIUM;  	//주의!
		bfan.on = false;
		System.out.println(bfan.toString());
		
	}//main
}//class

	


class Fan {
	final int SLOW = 1;
	final int MEDIUM = 2;
	final int FAST = 3;
	int speed = SLOW;
	boolean on = false;
	double radius = 5.0;
	String color = "blue";
	
	@Override //부모 클래스에서 정의된 메서드를
						//자손 클래스에서 다시 정의함
	public String toString() {
		String result = "";
		if(on == true){
			
			result += speed + "/" + color + "/" + 
						radius + "/" + "작동중";
		}else{
			result += color + "/" + radius + "/" + "꺼져잇음";			
		}
		return result;
	}


}
